UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+WK/ni1okUpeXS42uocgI5+bOU6t39lPb9/XCHcZF8I=' 
WHERE 
  key_id = '78526d64cb3b6dcf07acff3ce98a55cfe30b6e587f15e220ce88495e5ad47aaf' 
  AND (
    token = '+WK/ni1okUpeXS42uocgI5+bOU6t39lPb9/XCHcZF8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042