UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Jg3dkvPtN8QicNwS9/QyeVYjSNUgTZ5FLmXuguFDQM=' 
WHERE 
  key_id = 'f49b11a327bd2b7656dbbe479f111668395b886096451254bd4e8bd6e66f77f9' 
  AND (
    token = '7Jg3dkvPtN8QicNwS9/QyeVYjSNUgTZ5FLmXuguFDQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018