UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ufvKL9FOHia82ccoQ7Qq4JEviuQDrlqmkBLYh8ywGsI=' 
WHERE 
  key_id = 'd69f6450c46fb771c3ca8b7f9e485cdec20a0fbd2d2eef600e0c52298003c4af' 
  AND (
    token = 'ufvKL9FOHia82ccoQ7Qq4JEviuQDrlqmkBLYh8ywGsI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021