UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ly76qhVhScT2iND/iUD5pHlks8rD75j9JLGdiJ865AQ=' 
WHERE 
  key_id = 'a35adbff7c7e96f7d53f6c1dcafefb8c8420e0ce4fdc87790efa4787873ba7db' 
  AND (
    token = 'ly76qhVhScT2iND/iUD5pHlks8rD75j9JLGdiJ865AQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028