UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5DXeDxN+X9m4q0Ymb3iE9kO6Q1cc26114REygizV9dk='
WHERE
key_id = '3db832add284377e11548ea80d2739c624f94585b4f0cc7c58ec4eac64eca4c5'
AND (
token = '5DXeDxN+X9m4q0Ymb3iE9kO6Q1cc26114REygizV9dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)