UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hf8SCRRpPcQQ4raXvILFnVOmvAfUkJ5Zi7s0/j6Nj9A=' 
WHERE 
  key_id = 'b32e7175c8cd3cc4ab4ce44cb24cb0bc4da9fa596f325cbb4fd4dbcf7c6059ad' 
  AND (
    token = 'Hf8SCRRpPcQQ4raXvILFnVOmvAfUkJ5Zi7s0/j6Nj9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032