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

Query time 0.00021