UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wKj74hkzYEmTDCStbSynMslwPXiw8L6eeRBZg9sGf+U=' 
WHERE 
  key_id = '06933764c9054d599cbbb5f6c080054f7eba1c614e9078ad87db7fa189b54bf2' 
  AND (
    token = 'wKj74hkzYEmTDCStbSynMslwPXiw8L6eeRBZg9sGf+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021