UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pcndDxI+Z5qROx+QMKtw4Ef3ELvRB+9v+xuFplc7vJQ=' 
WHERE 
  key_id = '752c9f515ec7d837db5aebbb12cb90c80a7c30580fcfff58bf87b99d84d2456e' 
  AND (
    token = 'pcndDxI+Z5qROx+QMKtw4Ef3ELvRB+9v+xuFplc7vJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031