UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C2S0M37HKYwWWJ8ePopDn+wHD0P3ukXbdSx6VBNgsmE=' 
WHERE 
  key_id = '9578b47383a54bc9433d2ffe006153cddea6b71dd5f92eb7dbdcf6da78815da5' 
  AND (
    token = 'C2S0M37HKYwWWJ8ePopDn+wHD0P3ukXbdSx6VBNgsmE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052