UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LywBivrmLRuVwbezLRfKw+op+rF3fwrX6nPrMg0OBbs='
WHERE
key_id = '10052b367badf4bf2bbf74950fed3bd366f6f5924836327ef79e12e86b5832e0'
AND (
token = 'LywBivrmLRuVwbezLRfKw+op+rF3fwrX6nPrMg0OBbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)