UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZdcOLbWPoUc5WPcGlB76/fCireZ9sDzfKXFCwFfQCqI='
WHERE
key_id = '6d5398ff4a6db001f99af6e10ad9af6b891d3f014113a5ea2c40b2ef49729b7f'
AND (
token = 'ZdcOLbWPoUc5WPcGlB76/fCireZ9sDzfKXFCwFfQCqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)