UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IT00CPd7tJ/xh5LUyu2ccbZYvpyVMfuwKnXIk0RXbgE=' 
WHERE 
  key_id = '615b445f11fc12639c15e8f6c2e8251e1600cf781b8ca1dc06f84c5c9aad9d2a' 
  AND (
    token = 'IT00CPd7tJ/xh5LUyu2ccbZYvpyVMfuwKnXIk0RXbgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043