UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rjurtE8D4C4yiG3JmAjwS+P/2R1b+Hi36AA1yuJl86s='
WHERE
key_id = '12b9bede402b98b5ed7ffb943f404b16c0c823539397b1a52514f5b6513c1530'
AND (
token = 'rjurtE8D4C4yiG3JmAjwS+P/2R1b+Hi36AA1yuJl86s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)