UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HavZXNnKXCjqmgmJBfdQPGkjm5M2eukupVG4WClGjDo=' 
WHERE 
  key_id = '7f5692f27192fc36be1b7ac7d1e1c6ab5754775605ba7e21f1f0261e3828ab8d' 
  AND (
    token = 'HavZXNnKXCjqmgmJBfdQPGkjm5M2eukupVG4WClGjDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00183