UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xMe7vKF5NCQQppCAOI+0VV7/Y+VYyJGE1SbEO1GgUhc=' 
WHERE 
  key_id = '6a6dfadbc92182979d8d51bb4c1da322fa320b5af200294972086c046c1b0ac4' 
  AND (
    token = 'xMe7vKF5NCQQppCAOI+0VV7/Y+VYyJGE1SbEO1GgUhc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023