UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QYIjiMPUqtPRo0QQ529XU/n+43Ci5tnsRBPxsem4LPg='
WHERE
key_id = 'c7eeb8b8e319bf44484a51dd2cf56ae48c374a5cd9f1f216a154a91a1c56832e'
AND (
token = 'QYIjiMPUqtPRo0QQ529XU/n+43Ci5tnsRBPxsem4LPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)