UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rHqsYCIcytA4TZ4OYkxeVCJ4oFAl+H8mzUFcg9vvPhU=' 
WHERE 
  key_id = '12ab28a882470019083ec05b4960838bdbf1a31ffe138c1d58cdb393189bf6c6' 
  AND (
    token = 'rHqsYCIcytA4TZ4OYkxeVCJ4oFAl+H8mzUFcg9vvPhU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039