UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mB/IsjbOPjxop15k5Ji4U6mlMA8q3IvLm3RjfcjRos0=' 
WHERE 
  key_id = '5c400204c5cdd8ed28067ae18a1bcdfb6163905ba47083ec29a2313fa0d94f08' 
  AND (
    token = 'mB/IsjbOPjxop15k5Ji4U6mlMA8q3IvLm3RjfcjRos0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040