UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ro14BCAebdLUWWTwpjwzZMaRQKTEOVOhfoJdBqQeLNE=' 
WHERE 
  key_id = 'd0af8e0a40250754083e21e129eb265b9554d3d7891918610abf9e832f5a1cde' 
  AND (
    token = 'Ro14BCAebdLUWWTwpjwzZMaRQKTEOVOhfoJdBqQeLNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026