UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '79/uEhMYkHed2aUF/FIsWki6apcyxZ6XAElE8HWrJcQ=' 
WHERE 
  key_id = 'd58b870b3c382b3292184ce4997c55c9b8bd8fc12479cb70788d784c984bb2a9' 
  AND (
    token = '79/uEhMYkHed2aUF/FIsWki6apcyxZ6XAElE8HWrJcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038