UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QVMPX6Llkfc6k3DYyyZe9r3iXmSbuxwi81b4m6t6MjM='
WHERE
key_id = '88847386d8409cb363e7a458cb831cf35ef4aa85291b93f6308ab1c7b2053ee8'
AND (
token = 'QVMPX6Llkfc6k3DYyyZe9r3iXmSbuxwi81b4m6t6MjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)