UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pM5FIsxGH1k99sGPLOL05av/hj9HJXtvLM9VMeDImQY=' 
WHERE 
  key_id = '0297469c902310db0def4b29c339ca53f387533f86a708ad2e78c7e96aedf4ec' 
  AND (
    token = 'pM5FIsxGH1k99sGPLOL05av/hj9HJXtvLM9VMeDImQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048