UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wpfzYZsfQFC+imxeR8F6G1IWiQdiqMkcxj/xnXNEuOg=' 
WHERE 
  key_id = '9d01ba774fb60cc77eda1b338b0e53bfbc01fea487ad743733e6aaf5055bc049' 
  AND (
    token = 'wpfzYZsfQFC+imxeR8F6G1IWiQdiqMkcxj/xnXNEuOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064