UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ctgSmdFVMW1DaZTMPCRmUfIxXG8Xm2OZ6A8R9D1/5NM=' 
WHERE 
  key_id = '0273930199ff6eaa452ad3f0e877038fcf49907761fbc8d75ef340b4f63608b1' 
  AND (
    token = 'ctgSmdFVMW1DaZTMPCRmUfIxXG8Xm2OZ6A8R9D1/5NM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040