UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vZKL+WL0ve1uS7UVsKrjJ08gr5NGUukenVbran5qCTo=' 
WHERE 
  key_id = '34f4f39bb50981ab45987ee00e2e6effc0635f657edae6c03e4c01397ebb7b6a' 
  AND (
    token = 'vZKL+WL0ve1uS7UVsKrjJ08gr5NGUukenVbran5qCTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022