UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uj2wCpp5GPp54j0j67CQx9iSvN06WeS0SEB/bBstmfo='
WHERE
key_id = '65f3c5df47dc1ff562799e967e9da23b7c299e9da9c03d7d053d7e4703a70ffc'
AND (
token = 'Uj2wCpp5GPp54j0j67CQx9iSvN06WeS0SEB/bBstmfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)