UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vH4FS5GJACpQ7eucd01gqKXWGl4FglW7/U9QOTqjQzs='
WHERE
key_id = '44bfb15fd43e14582f7338b3819e9e2a49fbbd6395000e53bf5318deacd22a33'
AND (
token = 'vH4FS5GJACpQ7eucd01gqKXWGl4FglW7/U9QOTqjQzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)