UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LA01IUVA2EW6SabIGnJ+j+SvHd3iGvbvb2FKvvU8l/g=' 
WHERE 
  key_id = 'e22334eafbf8ef3adf3a5acb0fe74dbf17929c7a656d841b6f3d2e8a57979447' 
  AND (
    token = 'LA01IUVA2EW6SabIGnJ+j+SvHd3iGvbvb2FKvvU8l/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027