UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9JgsnFve9uDUlnLupjMRMMw1/MdA9OsFDPyp9QCwRFM=' 
WHERE 
  key_id = '256e04c2088bf25d75eadd6c8d73ee37ffb17e6433afcb3cf82487198d8fe278' 
  AND (
    token = '9JgsnFve9uDUlnLupjMRMMw1/MdA9OsFDPyp9QCwRFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030