UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wsoBdkbJBYMvPcT4Ck426wAQCQqU0Gr/aW9dJ99pJKY='
WHERE
key_id = '79f7ad2d84f7bc675906a1e6f4ad56d9b7e9eaf3c700eb568f1aaf0b89015a31'
AND (
token = 'wsoBdkbJBYMvPcT4Ck426wAQCQqU0Gr/aW9dJ99pJKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)