UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xAx2lTVt78qWC27r6Y+TiCZoX7Wxelwe42DfTHdGwbA=' 
WHERE 
  key_id = '9d1f436ed937b666b474da452d1eb01089b4fb89b6c2eee0235cbe3798945c2f' 
  AND (
    token = 'xAx2lTVt78qWC27r6Y+TiCZoX7Wxelwe42DfTHdGwbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031