UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zk6zNEvv12HZ4Of/leh5VAwTUS/ZJhnbGBojhZXmgW0='
WHERE
key_id = 'f6d47301dd174569c6f63d4000406dcc7a9cd91908e1888ede495b9df992ae81'
AND (
token = 'zk6zNEvv12HZ4Of/leh5VAwTUS/ZJhnbGBojhZXmgW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)