UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rAKpv1SJ72jiKSmpn6qY2oOopF7Xwu3b2Ew9W8vVVEY='
WHERE
key_id = '800d7c8a032025f09d9cd8fe8f17963c84a5e644043cfc785e46bb3cbcd7972a'
AND (
token = 'rAKpv1SJ72jiKSmpn6qY2oOopF7Xwu3b2Ew9W8vVVEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)