UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PfK7PZypBXiJhrzHW0DVbQuXG9bZiT4Yzs6uvViB/2Q=' 
WHERE 
  key_id = '841257e5dc912a6a5c8e29593f365184b7fae3bff92f29a78fd59364a8caf2e7' 
  AND (
    token = 'PfK7PZypBXiJhrzHW0DVbQuXG9bZiT4Yzs6uvViB/2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032