UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AU45rCVBaYL53KCrpMhZn955WGrzRD7ES6bVYmMv63s=' 
WHERE 
  key_id = 'd53722c4430cfad7b6f21226f77c22ff6af89fd628bb15c771111f71f66a80bf' 
  AND (
    token = 'AU45rCVBaYL53KCrpMhZn955WGrzRD7ES6bVYmMv63s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060