UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mCufmqp6Bv45Dq0T4KTiOOQ/32JYQOV0BsWyRPrsKpI='
WHERE
key_id = '3a83944f8d29488c727cc14f45fee75b40a5691a1379f783c7550a16f7fc6858'
AND (
token = 'mCufmqp6Bv45Dq0T4KTiOOQ/32JYQOV0BsWyRPrsKpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)