UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lX4oIYHhn38kk3xUIPfntY8HKld+ZIYH2QQ+cGCbzQM='
WHERE
key_id = '2fb279e36178032e26c66710bda9191c43a42d416502eb14e4fff7bd600950f3'
AND (
token = 'lX4oIYHhn38kk3xUIPfntY8HKld+ZIYH2QQ+cGCbzQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)