UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6SiNdfxFWaiczNK5stZ8NzbE46TfdVb7OBndbVJ95s0='
WHERE
key_id = 'fc8fcf0a2117387deec7436bffaa004eaf48aa12c1803bd70596465b8e17ed72'
AND (
token = '6SiNdfxFWaiczNK5stZ8NzbE46TfdVb7OBndbVJ95s0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)