UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ent+4fPkC3EZc+i9QjxvgMn/QSDiguL1Q7ARAxQ5Q0=' 
WHERE 
  key_id = '64de7cc2339f601e3e6d707421b3aaece97cceed5a6481663eaba3cbbdda1887' 
  AND (
    token = '7ent+4fPkC3EZc+i9QjxvgMn/QSDiguL1Q7ARAxQ5Q0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044