UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cz3miED40CpdkTnAHZsmaTk7cnpRyc/lYYIdYhWtZqA=' 
WHERE 
  key_id = '027af8b3961a5fff91ec78d99d0aadb3cd32f94127cfd687750adadc70ef30ba' 
  AND (
    token = 'cz3miED40CpdkTnAHZsmaTk7cnpRyc/lYYIdYhWtZqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036