UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MvGxldJ7bIEq1k1qzFW+qa066k9p7CA35OQna2sS6vk='
WHERE
key_id = 'b97e7e7eed5f4041fd868ed72a66ed5c7477ee66cc14443ca506570f59ada2a2'
AND (
token = 'MvGxldJ7bIEq1k1qzFW+qa066k9p7CA35OQna2sS6vk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)