UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I26kPukCof5wgLIWNOkUXBLrf2yiKWCEuo4ZnqdBaDM=' 
WHERE 
  key_id = '642e57d0d6a907f5803373964a1129bf778b6a737a56d2603dd1a6022e5b9d76' 
  AND (
    token = 'I26kPukCof5wgLIWNOkUXBLrf2yiKWCEuo4ZnqdBaDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017