UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AxUZ8jqWusFp/knEJepaYGBQHrQ2205mRoQIdrSjGhs='
WHERE
key_id = 'bb74a7cf48d3718397e1f493130f295dfd0e5cb678d349e3d3c99a112241e277'
AND (
token = 'AxUZ8jqWusFp/knEJepaYGBQHrQ2205mRoQIdrSjGhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)