UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Ok6i/xiFc2qNOIaHpee66npokgh9RHEtZwkGhApn0Y='
WHERE
key_id = 'dbfcaffc47fcaddbb2c9d26f83d59c5252d1aa8182be68ac5fc6246d58144c98'
AND (
token = '5Ok6i/xiFc2qNOIaHpee66npokgh9RHEtZwkGhApn0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)