UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ONIYVYWCIMtvf/2E742N1Cif8Bdsv4AEeLkenSdn3Q=' 
WHERE 
  key_id = '8d36f926bbdc93356387937ac014d09499e6ca86f131310c92aac0b4f080f6d8' 
  AND (
    token = '7ONIYVYWCIMtvf/2E742N1Cif8Bdsv4AEeLkenSdn3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028