UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XUVr0O/lvjzPJ30JZYP4bMjje14W9M5xkHls2wlCthE=' 
WHERE 
  key_id = '18ae45a577082c51b7a1d9deed2ec634a82eb260ce8a3547f0d8756a0639ab89' 
  AND (
    token = 'XUVr0O/lvjzPJ30JZYP4bMjje14W9M5xkHls2wlCthE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039