UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RYL4G+uSI+vPddxDhxWh6pzVf7Z6LOIMqs16kJKkpRo=' 
WHERE 
  key_id = 'ff79001df1623ce47963deb88881ccc528502c92ee03f2f96e10b13bded12d55' 
  AND (
    token = 'RYL4G+uSI+vPddxDhxWh6pzVf7Z6LOIMqs16kJKkpRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024