UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jzBQ0iiK3y/h2nCZ+RuWs/5AFKy4bNp+nqjwYeAM6Fs=' 
WHERE 
  key_id = '0f6abd8cd1d8ae2ffb18592bbbf9f4b99fabe4b84e8590722f4c4eb1c45f2424' 
  AND (
    token = 'jzBQ0iiK3y/h2nCZ+RuWs/5AFKy4bNp+nqjwYeAM6Fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023