UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LBu1finhkmJOkPczrFulhe3fnmT3+dAmovABcvvBHns=' 
WHERE 
  key_id = '396ea75d7183eea3eca12f09a04bf88454cd96fdf2ccd7001b96a5be853df9b7' 
  AND (
    token = 'LBu1finhkmJOkPczrFulhe3fnmT3+dAmovABcvvBHns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021