UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WRCUSEvBVyrSRpK4+rWsKzO8ozCRTtNrkAM3zblNmkI=' 
WHERE 
  key_id = '17c59b2ec31c75b45563364119eccd4b81e7c85e3ae7251e82bac9574fba06ce' 
  AND (
    token = 'WRCUSEvBVyrSRpK4+rWsKzO8ozCRTtNrkAM3zblNmkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032