UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c1JR7RX9Kuica7VxCC9tZjm4ZYL4Npur9atZIoRIaIY=' 
WHERE 
  key_id = '1a4ae7cd7506afc45c86f36926cd4c12d7acda7473d71c72d710e311f8cf6fa6' 
  AND (
    token = 'c1JR7RX9Kuica7VxCC9tZjm4ZYL4Npur9atZIoRIaIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033