UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+jB/dsRM7wnDtSmSgEwPODVZ20+sYEKG9XqEMeSaA2A=' 
WHERE 
  key_id = 'f3375ce8d866817bd8e72c370a00b378d430f224a4cf1b4e4365e63a0862a03d' 
  AND (
    token = '+jB/dsRM7wnDtSmSgEwPODVZ20+sYEKG9XqEMeSaA2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026