UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+5J3YSOMCRUjIwvAQwH4Ivd5EueNrT8bdeIwYCBgeCw=' 
WHERE 
  key_id = 'ec2ec102575b6cb031e66aa3d0cb5162e2cde0694352b0085e358a7c85bd1f5e' 
  AND (
    token = '+5J3YSOMCRUjIwvAQwH4Ivd5EueNrT8bdeIwYCBgeCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036