UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'esTdF7HGkzPeqvPwZ+dIgXVON6yXualishWyyKWkbJg=' 
WHERE 
  key_id = '7e3fb23b339cea6b0a55d7db2d70a90de49ba362e6e64c6fd73946f143654c72' 
  AND (
    token = 'esTdF7HGkzPeqvPwZ+dIgXVON6yXualishWyyKWkbJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031