UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1CtaZuEZhqH2E8mVkydQkKDUQcQW63PeR1mFujTcHA4='
WHERE
key_id = '02136c2c3cbf6792b8cf237d1a1c914bdfa8094bc6fdf2f758474e1054c73c03'
AND (
token = '1CtaZuEZhqH2E8mVkydQkKDUQcQW63PeR1mFujTcHA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)