UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1SKR3oP525rhwYQHvOslXASkIN966FgfeeZ+C6NeFlc=' 
WHERE 
  key_id = '20411fa9ba6bf321bb2fd50e1f75c23d6b5e9a5e1d88b235af224ff2004d6429' 
  AND (
    token = '1SKR3oP525rhwYQHvOslXASkIN966FgfeeZ+C6NeFlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057