UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FRSCTvb18e7zufT3CQaImZVA/79zR1VaXvvJroNgGbQ=' 
WHERE 
  key_id = 'dfe9c3cee1dbce41b1a5ef6635b4e4fb4fec4b5aaec88082774f243da2c48db6' 
  AND (
    token = 'FRSCTvb18e7zufT3CQaImZVA/79zR1VaXvvJroNgGbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043