UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zQwdSI0HtzwVig3oe0zQT0ZZZRXgNrMOzWdcTUpVKCM=' 
WHERE 
  key_id = 'e20091878c92446fede0581ec8f124e10ad7dc42c18553fb6f8c64fe38d4e346' 
  AND (
    token = 'zQwdSI0HtzwVig3oe0zQT0ZZZRXgNrMOzWdcTUpVKCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035