UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XzztXBMKGqC866LoVfVm4YRl758cFcZzlS0jPePvuNM=' 
WHERE 
  key_id = '3fe18614a9160b452f0b17142b2a2d35b25617c3b99ed0803aa93f342f62b195' 
  AND (
    token = 'XzztXBMKGqC866LoVfVm4YRl758cFcZzlS0jPePvuNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029