UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '955i/AlJgogLkrNaEVipylJI5i8eilyvUpjxJ9GuBZ4='
WHERE
key_id = 'c847796969ab1d9eeace84806d3701b093f66dad04cc6ce8430c42c5618749fe'
AND (
token = '955i/AlJgogLkrNaEVipylJI5i8eilyvUpjxJ9GuBZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)